﻿using System.Collections.Generic;

namespace Borg
{
    public interface IInstanceStoreReader
    {
        IEnumerable<Extension> Extensions { get; }
        IEnumerable<Plug> Plugs { get; }
        IEnumerable<Slot> Slots { get; }
        IEnumerable<Tag> Tags { get; }

        MetaElementCollection<Extension> GetExtensions(string name);
        MetaElementCollection<Plug> GetPlugs(string name);
        MetaElementCollection<Slot> GetSlots(string name);

        MetaElementCollection<Slot> GetSlotsWherePlugged(Plug plug);
        MetaElementCollection<Plug> GetPluggedPlugs(Slot slot);

        MetaElementCollection<Tag> GetTags(Slot slot);
        MetaElementCollection<Tag> GetTags(Plug plug);

        MetaElementCollection<Extension> GetExtensions(ExtensionType extensionType);
        Extension GetSharedExtension(ExtensionType extensionType);
        Extension GetExtension(object extensionObject);
        object GetExtensionObject(Extension extension);

        Plug GetPlug(object extensionObject, string name);
        Slot GetSlot(object extensionObject, string name);

        bool IsActivated(Extension extension);

        bool IsOpen(Slot slot);

        bool IsPlugged(Slot slot, Plug plug);
        bool IsTagged(Slot slot, Plug plug, string value);

        bool GetAutoOpen(Slot slot);

        bool GetAutoPlug(Slot slot);
        string[] GetAutoTag(Slot slot);

        bool GetShared(Slot slot);

        bool GetAutoPlug(Plug plug);
        string[] GetAutoTag(Plug plug);
    }
}
